import {Get,Post,Put} from './index.js'
export const books = p => Get(p,'books')		// 获取书籍列表
export const login = p => Post(p,'auth/login')				// 登录
export const register = p => Post(p,'auth/register')				// 注册
export const companiesList = p => Get(p,'companies/list')		// 所属单位
export const professionsList = p => Get(p,'professions')		// 工种
export const booksTree = p => Get(p,'books/tree')		// 对应的工种下的书籍列表
export const booksIdDetail = p => Get(p,`books/${p.id}`)		// 某个书籍的详情
export const booksDetail = p => Get('',`courses/${p.id}`)		// 书籍详情
export const nameMatches = p => Get(p,`professions/name-matches`)		// 工种名称模糊查询
export const userInfo = p => Get('',`users/${p.id}`)		// 用户详情
export const userInfoCourses = p => Get('',`users/${p.id}/compulsory-courses`)		// 查询学员必须课程
export const usersMy = p => Post(p,`users/my`)		// 修改个人信息
export const usersCourseStatistics = p => Get('',`users/${p.id}/user-course-statistics`)		// 统计会员学习情况
export const examsUnfinishedExam = p => Get(p,`exams/unfinished-exam`)		// 获取本人未结束的考试
export const exams = p => Post(p,`exams/type/exam?examPlanId=${p.examPlanId}`)		// 开启考试
export const examsAnswer = p => Post(p,`exams/${p.id}/question-id/${p.questionId}/answer/${p.answer}`)		// 答题
export const examsScore = p => Get(p,`exams/${p.id}/score`)		// 获取考试评分
export const examsStatistics = p => Get(p,`exams/statistics`)		// 个人考试统计
export const learnedCourseId = p => Post(p,`users/learned-course/${p.courseId}`)		// 完成学习课程
export const userPwd = p => Post('',`users/old-pwd/${p.oldPwd}/new-pwd/${p.newPwd}`)		// 修改用户密码
export const exercise = p => Post('',`exams/type/exercise?courseId=${p.courseId}`)		// 开始练习
export const usableExams = p => Get('',`exam-plans/usable-exams`)		// 用户考试列表
export const examsHistory = p => Get(p,`exams/history`)		// 考试历史记录
export const bookTreesCompulsory = p => Get(p,`book-trees/compulsory`)		// 小程序首页-必学页书籍展示
export const bookTreesOptional = p => Get(p,`book-trees/optional`)		// 小程序首页-选学页书籍展示
export const bookTreesExercise = p => Get(p,`book-trees/exercise`)		// 小程序练习书籍展示


export const banners = p => Get(p,`banners`)		// 新闻资讯/banner
export const bannersDetail = p => Get('',`banners/${p.id}`)		// 新闻资讯/banner
export const videoCenter = p => Get(p,`book-trees/video-center`)		// 新闻资讯/banner
export const studyingCourses = p => Get(p,`one-studies/studying-courses`)		// 每月一学/一课列表
export const authReport = p => Post(p,`auth/report?targetId=${p.targetId}`)		// 视频上报
export const oneExam = p => Get('',`exams/one-exam`)		// 视频上报
export const homeCenters = p => Get(p,`home-centers`)		// 视频列表/书籍列表
export const homeCentersBooks = p => Get(p,`home-centers/books?module=${p.module}`)		// 视频列表/书籍列表